#include "syscall.h"
#include "print.c"

int lock[405];
int cv[805];

int main(){
	int i;
	int printMsg[1];

	for(i = 0; i < 405; i++){
		printMsg[0] = i;
		/*printf("Create lock %d.\n", printMsg);*/
		lock[i] = CreateLock();
		if (lock[i] == -1) {
			printf("Create Lock Attempt [%d] failed...\n", printMsg);
		}
	}

	for(i = 0; i < 805; i++){
		printMsg[0] = i;
		/*printf("Create condition %d.\n", printMsg);*/
		cv[i] = CreateCondition();
		if (cv[i] == -1) {
			printf("Create Condition Attempt [%d] failed...\n", printMsg);
		}
	}	

	for(i = 0; i < 405; i++){
		printMsg[0] = i;
		/*printf("Destroy lock %d.\n", printMsg);*/
		DestroyLock(lock[i]);
		
	}	

	for(i = 0; i < 805; i++){
		printMsg[0] = i;
		/*printf("Destroy condition %d.\n", printMsg);*/
		DestroyCondition(cv[i]);
	}	

	Exit(0);
}
